<template>
	<Layout>
		<div>Post1</div>
		<ul>
			<!-- <li v-for="ele in posts" :key="ele.id">{{ ele.title }}</li> -->
			<!-- posts是别名 -->
			<li v-for="edge in $page.posts.edges" :key="edge.node.id">
				<g-link :to="edge.node.path">{{ edge.node.title }}</g-link>
			</li>
		</ul>
	</Layout>
</template>

<page-query>
# Write your query or mutation here
query {
  posts:allPost1{
    edges{
      node{
        id
        title
        content
		path
      }
    }
  }
}
</page-query>

<script>
import axios from 'axios';
export default {
	name: 'Post1',
	data() {
		return {
			posts: []
		};
	}
	// async created() {
	// 	const res = await axios.get(`http://jsonplaceholder.typicode.com/posts`);
	// 	console.log(res);
	// 	this.posts = res.data;
	// }
};
</script>

<style></style>
